package com.zhuss.controller.team.information;

import com.zhuss.bean.bo.team.information.wechat.DetailWeChatInfoBo;
import com.zhuss.bean.bo.team.information.wechat.SearchWeChatInfoBo;
import com.zhuss.common.BaseController;
import com.zhuss.exception.WpsException;
import com.zhuss.team.information.InformationReadServiceWechat;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;


/**
 * 订单操作 controller
 * @Author zhushanshuo
   @Date 2020/03/11 16:01
 *
 */
  
 
@RestController
@RequestMapping("/information")
public class InfoReadController extends BaseController {
	
	@Autowired
	@Qualifier("informationReadServiceWechat")
	private InformationReadServiceWechat informationReadServiceWechat;
	
	/**
	 * 获取微信通知公告列表
	 * @param bo
	 * @throws WpsException
	 */
	@ResponseBody
    @PostMapping("/noticeList")
	@Transactional(rollbackFor = Exception.class)
    public Object noticeList(@RequestBody SearchWeChatInfoBo bo) throws WpsException {
		Object result = informationReadServiceWechat.noticeList(bo);
		return result;
    }

	/**
	 * 获取微信新闻资讯列表
	 * @param bo
	 * @throws WpsException
	 */
	@ResponseBody
	@PostMapping("/newsList")
	@Transactional(rollbackFor = Exception.class)
	public Object newsList(@RequestBody SearchWeChatInfoBo bo) throws WpsException {
		Object result = informationReadServiceWechat.newsList(bo);
		return result;
	}

	/**
	 * 小程序段详情
	 * @param bo
	 * @return
	 * @throws WpsException
	 */
	@ResponseBody
	@PostMapping("/weChatDetail")
	@Transactional(rollbackFor = Exception.class)
	public Object weChatDetail(@RequestBody DetailWeChatInfoBo bo) throws WpsException {
		Object result = informationReadServiceWechat.weChatDetail(bo);
		return result;
	}
	
}
